# !/usr/bin/env python
# -*- coding:utf-8 -*-
# project name: CP_Automation
# author: "Lei Yong" 
# creation time: 2018/7/5 14:32
# Email: leiyong711@163.com

import unittest
from Operation.element import Element
from selenium.webdriver.common.keys import Keys
import time
import os

el = Element()


class Test(unittest.TestCase):
    """厅主后台-后台权限"""

    @classmethod
    def setUpClass(cls):
        cls.driver = el.Driver()
        el.windowMax()

    def test01(self):
        """登录厅主后台"""
        el.openurl('http://192.168.1.203:8090/#/login')
        el.windowMax()
        el.css('[type="text"]').send_keys('leiyong')
        el.css('[type="password"]').send_keys('123456')
        value = el.get_verificationCode(el.css('.valid_img'))
        el.css('[type="telephone"]').send_keys(value)
        el.css('button').click()
        time.sleep(10)
        # self.assertTrue(el.trywait_assert(el.xpath("//div[@id='app']/div[@class='app pc']//div[@class='ant-layout ant-layout-has-sider']/div[@class='ant-layout']//div[@class='ant-row']/div[12]/button[@type='button']").click()))

    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()